﻿package net.ssta.core.db;

import java.sql.Connection;
import java.sql.SQLException;

import net.ssta.common.Constants;
import net.ssta.core.util.DateUtility;
import net.ssta.core.web.RequestKit;


public class DbTestMain {

	/**
	 * @param args
	 * @throws DBException 
	 */
	public static void main(String[] args)  
	{
		//添加用户信息表
		Connection conn = null;
    	String forwardurl = "";
    	Record record = new Record();
    		//获取数据库链接
    		try {
				conn = DBConnectionProvider.getConnection(Constants.JNDI_SSTA);
				Record r=new Record();
				r.setConnection(conn);
		    	r.setEntityName("T_USER_POINT");
		    	r.setPrimaryKey("CID");
		    	r.addData("USERID","userId");
		    	r.addData("USERPOINT",new Integer(1000));
		    	r.addData("STARTDATE", "2010-01-02");
		    	r.addData("ENDDATE", "2010-01-03");
		    	r.create();
		    	
    		} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				
			}finally{
				try{
					if(conn != null) conn.close();
				}catch (SQLException e){
				}
			}
		 
	}

}
